package com.xyoto.community.controller;

import com.xyoto.community.service.PictureService;
import com.xyoto.community.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 前端资源上传到oss
 */
@Api(tags = "前端资源上传到oss")
@RestController
@RequestMapping("/frontSource")
public class FrontEndStaticResourcesUploadController {

    @Autowired
    private PictureService pictureService;

    @ApiOperation("上传图片到oss")
    @PostMapping("/upload/icon")
    public Result uploadIcon(MultipartFile multipartFile){
        return pictureService.uploadFrontIcon(multipartFile);
    }

}
